<template>
    <div class="integralList">
        <div class="content" v-if="integralUseList.length">
            <template v-for="(i, idx) in integralUseList" :key="idx">
                <div class="content-item">
                    <p class="content-item-title">积分</p>
                    <p v-if="i.status == 1" class="content-item-success">+ {{ i.record }} 积分</p>
                    <p v-else-if="i.status == 2" class="content-item-fail">- {{ i.record }} 积分</p>
                </div>
            </template>
        </div>
        <nut-empty description="无数据" v-else></nut-empty>
    </div>
  </template>
  
  <script>
 import { onMounted, reactive, toRefs } from 'vue';
import './index.scss';
import { GetUserIntegralUseList } from '../utils/api.js' 
import { Del, Edit, Checklist } from '@nutui/icons-vue-taro';
import Taro from '@tarojs/taro'
import currency from 'currency.js'
import { stat } from 'fs';
  export default {
    name: 'Index',
    components: {
    },
    setup(){
        const state = reactive({
            integralUseList: [],
          
        });
        const GetUserIntegralUse = async () => {
            let integralUseListRes = await GetUserIntegralUseList({});
            if(integralUseListRes.code == 200) {
                state.integralUseList = integralUseListRes.data.list;
            }
        }
        onMounted(() => {
            GetUserIntegralUse();
        })
        return {
            ...toRefs(state),
        }
    }
  }
  </script>
  
  